#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#define OJ_TEST 0
#define LOCAL_TEST 0

#define M 20011

static int max(int a, int b){ return a>b?a:b; }
static int min(int a, int b) { return a<b?a:b; }

static void solve(void){
	static int nice[M];
	long long opt, now;
	int n, stops, routes, pstop;
	int i, opts, opte;
	for(scanf("%d", &n), routes=1; routes<=n; ++routes){
		scanf("%d", &stops);
		for(i=1; i<stops; ++i){
			scanf("%d", nice+i);
		}
		opt=now=nice[1]; pstop=1;
		opts=1; opte=2;
		for(i=2; i<stops; ++i){
			if(now>=0){
				now += nice[i];
			}else{
				pstop = i;
				now = nice[i];
			}
			if(now > opt){
				opt = now;
				opts=pstop, opte=i+1;
			}else if(now==opt && (i+1-pstop)>(opte-opts)){
				opte = i+1; opts=pstop;
			}
		}
		if(opt<=0){
			printf("Route %d has no nice parts\n", routes);
		}else{
			printf("The nicest part of route %d is between stops %d and %d\n", routes, opts, opte);
		}

	}

}
#if OJ_TEST
	int main(int ac, char *av[]){
		solve();
		return 0;
	}
#elif  LOCAL_TEST
	void run(void){
		solve();
	}

#else

#endif
